/*
 * Created by Asnull.
 * Website:https://lipux.cn/
 * Date:2023-1-28
 */

// 依赖模块
const express = require("express");
const cors = require('cors');

// 路由模块化
const manageFile = require('./router/manageFile');
const getInfo = require('./router/getInfo');

// 创建服务器实例
let port = 3030;
const app = express();
app.listen(port,() => {
    console.log(`服务器已启动！正在监听端口 ${port}. Created by Asnull.My personal website:https://lipux.cn/`);
});

// 托管静态页面
app.use(express.static('web'))

// 解决跨域
app.use(cors());

// 配置解析表单数据的中间件
app.use(express.urlencoded({ extended: false }))
app.use(express.json());

// 注册路由模块
// 上传相关
app.use('/manage_file', manageFile);
// 获取相关数据信息
app.use('/get_info',getInfo)
